<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core">

<h:head>
	<title>JSF2 Ajax Demo Page</title>
</h:head>
<h:body>
	<h:form id="form1" prependId="false">
		<h:outputScript name="jsf.js" library="javax.faces" target="head" />
		<h:outputText id="out1" value="#{count.count}" />
		<br />
		<!-- Increment the counter on the server, and the client -->
		<h:commandButton id="button1" value="Count"
			onclick="jsf.ajax.request(this, event, {execute: this.id, render: 'out1'}); return false;" />
		<br />
		<!-- Resets the counter, doesn't refresh the page -->
		<h:commandButton id="reset" value="reset"
			onclick="jsf.ajax.request(this, event, {execute:'reset', render: 'out1'}); return false;"
			actionListener="#{count.reset}" />
		<h:messages />
	</h:form>
	<p>
		<h:outputLink
			value="http://weblogs.java.net/blog/driscoll/archive/2008/11/a_simple_ajax_j.html">
            Blog discussing this example.
        </h:outputLink>
	</p>
</h:body>
</html>